using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class UNIT1Map : EntityTypeConfiguration<UNIT1>
    {
        public UNIT1Map()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.NAME)
                .HasMaxLength(50);

            this.Property(t => t.SYMBOL)
                .HasMaxLength(8);

            // Table & Column Mappings
            this.ToTable("UNITS");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.NAME).HasColumnName("NAME");
            this.Property(t => t.SYMBOL).HasColumnName("SYMBOL");
        }
    }
}
